// 重载运算符 输出类
#include <iostream>

using namespace std;

// 时间类
class Time
{
    // 设置友元
    friend ostream &operator<<(ostream &out, Time &ob);
    friend istream &operator>>(istream &in, Time &t);
public:
    Time();
    Time(int h, int m, int s);
    Time(const Time & ob);
    ~Time();    
private:
    int mHour;
    int mMin;
    int mSec;
};

// 重载插入运算符
ostream &operator<<(ostream &out, Time &ob)
{
    out << ob.mHour << " " << ob.mMin << " " << ob.mSec;
    return out;
}

istream &operator>>(istream &in, Time &t)
{
    in >> t.mHour >> t.mMin >> t.mSec;
    return in;
}

int main(int argc, char **argv)
{
    Time t(1, 2, 3);
    cin >> t;

    cout << t << t << endl;


    return 0;
}



Time::Time()
{
    // 无参构造
    this->mHour = 0;
    this->mMin = 0;
    this->mSec = 0;
}

Time::Time(int h, int m, int s)
{
    // 有参构造
    this->mHour = h;
    this->mMin = m;
    this->mSec = s;
}

Time::Time(const Time & ob)
{
    // 拷贝构造
    this->mHour = ob.mHour;
    this->mMin = ob.mMin;
    this->mSec = ob.mSec;
}

Time::~Time()
{
    // 析构函数
}  
